typedef unsigned char byte;

byte * ethernet_frame(char * srcaddr, char * destaddr, unsigned short type, const char * data, unsigned int len);

// IP packet is base for TCP, UDP, and ICMP
byte * ip_packet(const char * _src, const char * _dest,
		byte _TOS, unsigned int _id, char * _data,
		unsigned char _proto, unsigned int _checksum,
		unsigned int len);

byte * tcp_packet(const char * _src, const char * _dest,
		byte _TOS, unsigned int _id,
		char * _data, unsigned int _len,
		unsigned short _srcport, unsigned short _destport,
		unsigned int _seq, unsigned int _ack, byte _flags,
		unsigned int _checksum);


byte * udp_packet(const char * _src, const char * _dest,
		byte _TOS, unsigned int _id,
		char * _data, unsigned int _len,
		unsigned short _srcport, unsigned short _destport,
		unsigned int _checksum);

byte * icmp_packet(const char * _src, const char * _dest,
		byte _TOS, unsigned int _id,
		unsigned char icmp_type, unsigned char icmp_code,
		unsigned short int icmp_id, unsigned short int icmp_seq,
		unsigned int _checksum);

// Allow IP spoofing but not HW spoofing
byte * arp_packet(unsigned short operation, const char * src_ip, char * dest_hw, const char * dest_ip);
